package com.yuhanginfo.modules.web.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.yuhanginfo.common.service.TreeService;
import com.yuhanginfo.modules.web.dao.WebAreaDao;
import com.yuhanginfo.modules.web.entity.WebArea;

/**
 * 区域Service
 * @author YuHangInfo
 * @version 2014-05-16
 */
@Service
@Transactional(readOnly = true)
public class WebAreaService extends TreeService<WebAreaDao, WebArea> {
    @Autowired
    private WebAreaDao areaDao;

	@Transactional(readOnly = false)
	public void save(WebArea area) {
		super.save(area);
	}
	
	@Transactional(readOnly = false)
	public void delete(WebArea area) {
		super.delete(area);
	}

	public WebArea selectAreaByCode(String code){
		return areaDao.selectAreaByCode(code);
	}

	public List<WebArea> selectProvinceList() {
		
		return areaDao.selectProvinceList();
	}

	public List<WebArea> cityList(String id) {
		
		return areaDao.cityList(id);
	}

	public List<WebArea> areaList(String id) {
		
		return areaDao.areaList(id);
	}
	
	public List<WebArea> getProvince() {
		return areaDao.getProvince();
	}
	
	public List<WebArea> selectByParent(String parentId) {
		return areaDao.selectByParent(parentId);
	}
}
